﻿<UserControl x:Class="TextAdventures.Quest.EditorControls.ScriptToolbar"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <UserControl.Resources>
        <Style TargetType="{x:Type Image}" x:Key="toolbarImageStyle">
            <Style.Triggers>
                <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type Button}, AncestorLevel=1}, Path=IsEnabled}" Value="False">
                    <Setter Property="Opacity" Value="0.50"></Setter>
                </DataTrigger>
            </Style.Triggers>
        </Style>
    </UserControl.Resources>
    <Grid UseLayoutRounding="True">
        <ToolBarTray Background="{x:Null}">
            <ToolBar KeyboardNavigation.TabNavigation="Local" ToolBarTray.IsLocked="True">
                <Button Name="cmdMakeEditable" Click="cmdMakeEditable_Click" Visibility="Collapsed">Make Editable Copy</Button>
                <Button Name="cmdDelete" ToolTip="Delete" Click="cmdDelete_Click" SnapsToDevicePixels="True">
                    <Image Style="{StaticResource toolbarImageStyle}" RenderOptions.BitmapScalingMode="NearestNeighbor" Width="16" Height="16" Source="./Images/DeleteHS.png" SnapsToDevicePixels="True"></Image>
                </Button>
                <Separator/>
                <Button Name="cmdMoveUp" ToolTip="Move up" Click="cmdMoveUp_Click" SnapsToDevicePixels="True">
                    <Image Style="{StaticResource toolbarImageStyle}" RenderOptions.BitmapScalingMode="NearestNeighbor" Width="16" Height="16" Source="./Images/Up.png" SnapsToDevicePixels="True"></Image>
                </Button>
                <Button Name="cmdMoveDown" ToolTip="Move down" Click="cmdMoveDown_Click" SnapsToDevicePixels="True">
                    <Image Style="{StaticResource toolbarImageStyle}" RenderOptions.BitmapScalingMode="NearestNeighbor" Width="16" Height="16" Source="./Images/Down.png" SnapsToDevicePixels="True"></Image>
                </Button>
                <Separator/>
                <Button Name="cmdCut" ToolTip="Cut" Click="cmdCut_Click" SnapsToDevicePixels="True">
                    <Image Style="{StaticResource toolbarImageStyle}" RenderOptions.BitmapScalingMode="NearestNeighbor" Width="16" Height="16" Source="./Images/CutHS.png" SnapsToDevicePixels="True"></Image>
                </Button>
                <Button Name="cmdCopy" ToolTip="Copy" Click="cmdCopy_Click" SnapsToDevicePixels="True">
                    <Image Style="{StaticResource toolbarImageStyle}" RenderOptions.BitmapScalingMode="NearestNeighbor" Width="16" Height="16" Source="./Images/CopyHS.png" SnapsToDevicePixels="True"></Image>
                </Button>
                <Button Name="cmdPaste" ToolTip="Paste" Click="cmdPaste_Click" SnapsToDevicePixels="True">
                    <Image Style="{StaticResource toolbarImageStyle}" RenderOptions.BitmapScalingMode="NearestNeighbor" Width="16" Height="16" Source="./Images/PasteHS.png" SnapsToDevicePixels="True"></Image>
                </Button>
                <Separator Name="codeViewSeparator" />
                <ToggleButton Name="cmdCodeView" ToolTip="Code View" Click="cmdCodeView_OnClick" SnapsToDevicePixels="True">
                    <Image Style="{StaticResource toolbarImageStyle}" RenderOptions.BitmapScalingMode="NearestNeighbor" Width="16" Height="16" Source="./Images/EditCodeHS.png" SnapsToDevicePixels="True"></Image>
                </ToggleButton>
                <Separator Name="popOutSeparator" />
                <Button Name="cmdPopOut" ToolTip="Pop out" Click="cmdPopOut_Click" SnapsToDevicePixels="True">
                    <Image Style="{StaticResource toolbarImageStyle}" RenderOptions.BitmapScalingMode="NearestNeighbor" Width="16" Height="16" Source="./Images/FullView.png" SnapsToDevicePixels="True"></Image>
                </Button>
            </ToolBar>
        </ToolBarTray>
    </Grid>
</UserControl>
